import 'package:foxue/http/manager.dart';

Future getFoxueList() async {
  String url = "/foxue/";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getFoxueBookDirectory(String id) async {
  String url = "/foxue/directory?id=$id";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getFoxueDetail(String id) async {
  String url = "/foxue/detail?id=$id";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future searchFoxue(String key) async {
  String url = "/foxue/search?key=$key";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}
